package cn.com.w.bootdemo.config;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;


//@Component // 想要观察输出顺序，放开此注释
public class MyConfig implements InitializingBean, DisposableBean {

    public MyConfig() {
        System.out.println("执行构造方法。");
    }

    @Override
    public void destroy() throws Exception {
        System.err.println("执行destroy() 方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.err.println("执行 afterPropertiesSet()方法。");
    }
}
